// 包含min函数的栈
// 同样实现pop, push 可以使用栈实现
function minStack() {
    this.stack = [];
    this.min = []
}
minStack.prototype.push = function (x) {
    this.stack.push(x);
    this.min.push(Math.min(this.min[this.min.length - 1], x))
}
minStack.prototype.pop = function () {
    let item = this.stack.pop();
    this.min.pop()
    return item;
}
minStack.prototype.pop = function () {
    return this.stack[this.stack.length - 1]
}
minStack.prototype.getmin = function () {
    return this.min[this.min.length - 1];
}
